<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\index\controller;

use app\common\service\ArvatoApiService as ArvatoApiService;
/**
 * Description of ArvatoApi
 *
 * @author dxx
 */
class Arvatoapi extends \app\common\controller\AuthBase {

    public function __construct() {
        parent::__construct();
    }

    public function action() {
        $params = $this->input();
        if (!$params['function']) {
            $this->outPutError(['msg' => "function is empty"]);
        }
        if (!count($params['data'])) {
            $this->outPutError(['msg' => "data is empty"]);
        }
        
        //$return = $this->_send($params['function'], $params['data']);
        
        $ArvatoApiService = new ArvatoApiService();
        $return = $ArvatoApiService->send($params['function'], $params['data']);
        return $this->output($return);
    }

}
